package com.lemon.utils.upload;

import java.awt.image.BufferedImage;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;

import javax.imageio.ImageIO;

/**
 * <p>Title: cityUploadUtils</p>
 * <p>Description: 
 * </p>
 * <p>Company: </p>
 * @author Ran_cc
 * @date 2018年11月29日
 * @版本 V 1.0 
 */
public class CityUploadUtils {
	/**
	 * 获取服务器上的图片的宽高尺寸
	 * 
	 * @throws FileNotFoundException
	 * @throws IOException
	 */
	public static String getImgWH(String _url) throws Exception {
		URL url = new URL(_url);
		URLConnection connection = url.openConnection();
		connection.setDoOutput(true);
		BufferedImage image = ImageIO.read(connection.getInputStream());
		int srcWidth = image.getWidth();      // 源图宽度
		int srcHeight = image.getHeight();    // 源图高度
		return srcWidth + "," + srcHeight;
	}

}
